package shopping.demo.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import shopping.demo.cache.KillCache;
import shopping.demo.entities.Goods;
import shopping.demo.util.RedisUtil;

import javax.annotation.PostConstruct;

@Service
public class KillService {

    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private KillCache killCache;
    @Autowired
    private OrderService orderService;
    @Autowired
    private GoodsService goodsService;
    @Autowired
    private UserService userService;
    private Logger logger = LoggerFactory.getLogger(KillService.class);
    //在项目的开始对已设置为秒杀的商品进行一个redis预热
//    @PostConstruct
//    public void killInit(){
//        for (Goods goods : goodsService.FindKilled()) {
//           killCache.setKillCache(goods);
//        }
//        logger.info("Kill预热完毕");
//    }
}
